﻿@model UserProfileEditModel
@{
    Layout = "_UserSpaceSettings";
    string userName = ViewData["UserName"] as string;
    ViewData["UserSettingsMenu"] = UserSettingsMenu.EachRequest;
    Html.IncludeScript("~/Scripts/tunynet/tn.solarlunar.js");
}
@section Aside
{
    @Html.Partial("_UserSettingsMenus")
}

<div class="tn-box tn-widget tn-widget-content tn-corner-all tnc-user-set tnc-basic-info">
    <div class="tn-box-content tn-widget-content tn-corner-all">
        <div class="tnc-basic-info-wrap">
            <div class="tn-main-heading tn-border-gray tn-border-bottom">
                <div class="tn-option">
                </div>
                <h2>
                    基本要求
                </h2>
            </div>
            @using (Html.BeginAjaxForm("EditEachRequest", "UserSpaceSettings", new RouteValueDictionary { { "spaceKey", Url.SpaceKey() } }, FormMethod.Post, new AjaxFormOptions { OnSuccessCallBack = "OnSuccessCallBack" }, htmlAttributes: new { id = "CreateWork" }))
            {
                <div class="tn-form-box">
                    <table style=" width:90%">
                        @Html.HiddenFor(model => model.UserId)
                        @Html.HiddenFor(model => model.UserName)
                        <tr>
                            <th>用户名：</th>
                            <td>
                                @if (string.IsNullOrEmpty(Model.AccountEmail))
                                {
                                    @Html.TextBoxFor(n => n.UserName, InputWidthTypes.Long, new RouteValueDictionary { { "autocomplete", "off" } })
                                    @Html.ValidationMessageFor(n => n.UserName)
                                }
                                else
                                {
                                    <div class="tn-explain"><strong>@userName</strong></div>
                                }
                            </td>
                            <th></th>
                            <td><div class="tn-option">@Html.Link("修改密码", SiteUrls.Instance().ChangePassword(Url.SpaceKey()), "修改密码")</div></td>
                        </tr>
                        <tr>
                            <th>
                                身高：
                            </th>
                            <td>@Html.TextBoxFor(n => n.OtherHeight)</td>
                            <th>
                                性格：
                            </th>
                            <td>@Html.TextBoxFor(n => n.OtherCharacter)</td>
                        </tr>
                        <tr>
                            <th>
                                住房情况：
                            </th>
                            <td>@Html.DropDownListFor(n => n.OtherHousingSituation, new System.Collections.ArrayList() { "与父母同住", "租房", "已购房", "住单位房", "住亲朋家" }, new { @class = "tn-dropdownlist tnc-basicinfor-bday" })</td>
                            <th>
                                职业：
                            </th>
                            <td>@Html.TextBoxFor(n => n.OtherOccupation)</td>
                        </tr>
                        <tr>
                            <th>
                                户口：
                            </th>
                            <td>@Html.TextBoxFor(n => n.OtherRegistered)</td>
                            <th>
                                居住地点：
                            </th>
                            <td>@Html.TextBoxFor(n => n.OtherPlaceResidence)</td>
                        </tr>
                        <tr>
                            <th>
                                学历：
                            </th>
                            <td>@Html.DropDownListFor(n => n.OtherEducation, new System.Collections.ArrayList() { "高中", "大专", "本科", "硕士", "博士", "其他" }, new { @class = "tn-dropdownlist tnc-basicinfor-bday" })</td>
                            <th>
                                婚姻状况：
                            </th>
                            <td>
                                @Html.DropDownListFor(n => n.OtherMaritalStatus, new System.Collections.ArrayList() { "未婚", "离异", "丧偶", "未婚有子女", "离异有子女", "丧偶有子女" }, new { @class = "tn-dropdownlist tnc-basicinfor-bday" })
                            </td>
                        </tr>
                        <tr>
                            <th>
                                工作地点：
                            </th>
                            <td>@Html.TextBoxFor(n => n.OtherPlaceWork)</td>
                            <th>

                            </th>
                            <td></td>
                        </tr>
                        <tr>
                            <th>&nbsp;</th>
                            <td>@Html.Button("保存", ButtonTypes.Submit, HighlightStyles.Primary, htmlAttributes: new { id = "saveProfile" })</td>
                        </tr>
                    </table>
                </div>
            }
        </div>
    </div>
</div>
<script type="text/javascript">
    function OnSuccessCallBack(data) {
        art.dialog.tips(data.MessageContent, 1.5, data.MessageType, function () {
            window.location.reload();
        });
    }
    $(document).ready(function () {
        window.location.href = "#StatusMessage";
        $("div[name='StatusMessageDiv'] a.tn-smallicon-cross").click(function () {
            $(this).parents("div[name='StatusMessageDiv']:first").fadeOut("normal");
        });
    });
</script>